<template>
  <div class="plat-form-wrap">
    <Banner :bgImg="bgImg" :search="true" @search="search"></Banner>
  </div>
</template>

<script>
import Banner from '@/views/components/banner.vue'
import mixinsBackStack from '@/views/backstageSupport/mixins'
import { getBlackHorse } from '@/api/frontCommon'
import { getTimeLimit } from '@/api/linkManage'
import FrontMixins from '@/mixins/frontMixin'
import { getStorage } from '@/utils/index'

export default {
  mixins: [mixinsBackStack, FrontMixins],
  data() {
    return {
      bgImg: require('@/assets/images/patentBanner.png'),
      token:''
    }
  },
  created() {
    this.token = `${getStorage('token', 0)}`
  },
  components: {
    Banner,
  },
  methods: {
    async search(e) {
      const result = await getTimeLimit(6)  //后台控制
      if (result.data == 0) return this.info()
      const { msg, code } = await getBlackHorse()
      if (code !== 200) return this.$message.warning(msg)
      window.open(`https://himmpat.com/lib/foshan?cipher=${this.token}&query=${e}`)
    }
  }
}
</script>

<style lang="scss" scoped>
.banner {
  margin: 0;
}
</style>
